package cn.nkpro.elcube.task.model;

import lombok.Data;
import org.camunda.bpm.engine.form.FormField;
import org.camunda.bpm.engine.form.FormFieldValidationConstraint;
import org.camunda.bpm.engine.form.FormType;

import java.io.Serializable;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * @Description :流程图表单实体类
 * @Author : YF
 * @Date: 2022-05-19 16:22  //时间
 */
@Data
public class BpmFormField implements Serializable, FormField {
    private boolean businessKey;
    private Object defaultValue;
    private String id;
    private String label;
    private Map<String,String> properties;
    private Object options;
    private String typeName;
    private List<BpmFormFieldValidationConstraint> validationConstraints;
    private BpmTypedValue value;

    @Override
    public FormType getType() {
        return null;
    }

    @SuppressWarnings("all")
    public List<FormFieldValidationConstraint> getValidationConstraints(){
        return this.validationConstraints.stream().collect(Collectors.toList());
    }
}
